const { Schema, model } = require("mongoose");

const userSchema = new Schema({
    __v: { type: Number, select: false },
    username: { type: String, required: true, unique: true }, // 用户名
    password: { type: String, required: true, select: false }, // 密码
    avatar: { type: String, default: "" },
    deleted: { type: Number, enum: [0, 1], default: 0, select: false }, // 是否删除【管理员操作】
    create_time: {
        type: Date,
        default: Date.now,
        select: false,
    },
});

module.exports = model("User", userSchema);
